<meta charset="utf-8">
<div style="width:100%" id='clienteView'>
    <?php if($this->session->flashdata('respcli') != "" ){ ?>
        <div class='alert alert-info'><?=$this->session->flashdata('respcli')?></div>  
    <?}?>         
    <?php
    foreach ($clientes as $row){

        if($row->tipo != 'J'){
        	$pessoa = "fisico";
            $this->table->set_heading('Matricula','Cliente','CPF','Tel. Fixo','Tel Movel', 
                    'Email','Status'
        );        
        }else{
        	$pessoa = "juridico";
            $this->table->set_heading('Matrícula','Cliente','CNPJ','Tel. Fixo','Tel. Móvel', 
                    'Email','Representante','Tel Fixo','Tel. Móvel','Status');
        }
        $susp = $row->susp != 0 ? $susp = "inapto" : "apto";           
            if($row->susp != 0){
                $acao = "<a href=".base_url()."admin/habilita".$pessoa."/$row->usuario_idusuario><img src=".base_url()."img/icons/like_16x16.png></a> - inapto";
            }
            else{
                $acao = "<a href=".base_url()."admin/desabilita".$pessoa."/$row->usuario_idusuario><img src=".base_url()."img/icons/dislike_16x16.png></a> - apto";
            }
            $susp = $row->susp != 0 ? $susp = "<img src=".base_url()."img/icons/dislike_16x16.png> Negativa" 
                : "<img src=".base_url()."img/icons/like_16x16.png> Positiva";
        /*else{
            $suspensao = $row->susp != 0 ? $suspensao = '-' : $suspensao =  anchor("reserva/geraBoleto/$row->idboleto","<img src=".base_url()."img/icons/coins17.png>", array('id'=>'gBoletoCliente'));
            $this->table->add_row($row->numboleto, $row->nome, $row->descricao_reserva, 
            $pgto, date('d/m/Y',(strtotime($row->dtinicial))), date('d/m/Y',(strtotime($row->dtfinal))), 
            $row->nparcela.'/'.$row->tparcelas,date('d/m/Y',(strtotime($row->dtvencimento))),number_format($row->valor,2,',','.'),            
            $suspensao
            //anchor("reserva/geraBoleto/$row->idboleto","<img src=".base_url()."img/icons/coins17.png>")//, anchor("pagamento/encaminha/$row->idboleto","<img src=".base_url()."img/icons/share_16x16.png>")                       
            //anchor("reserva/geraBoleto",$baixa), anchor("pagamento/encaminha/$row->idboleto","<img src=".base_url()."img/icons/share_16x16.png>")//,
            //anchor("pagamento/exclui/$row->idboleto","<img src=".base_url()."img/icons/delete_16x16.png>", array('id'=>'exclui', 'value'=>$row->idboleto))
            );             
        }*/
        if($row->tipo != 'J'){
            $this->table->add_row($row->usuario_idusuario, $row->nome, $row->nregistro, 
                $row->telfixo, $row->telmovel, $row->email, $acao);
        }else{
        	$this->table->add_row($row->usuario_idusuario, $row->nome, $row->nregistro, 
                $row->telfixo, $row->telmovel, $row->email, $row->nome_rep, $row->email, $row->telfixo_rep, $row->telmovel_rep, $acao);        	
        }
    }
    $tmpl = array ( 'table_open'  => '<table class="display" id="treserva">' );
    $this->table->set_template($tmpl);
    echo $this->table->generate();
    ?>
</div>